/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package day06;

/**
 *
 * @author Administrator
 */
public class Rectangle extends AShape {

    private double width;
    private double hight;

    public Rectangle(APoint apoint, String color, double width, double hight) {
        super(apoint, color);
        this.width = width;
        this.hight = hight;
    }
  /*
   * Dien tich
   */  
    @Override
    public double dientich(){
     return this.width * this.hight;    
    }
    /*
     * Chu vi
     */
    @Override
    public double chuvi(){
        return (this.width + this.hight)*2;        
    }
    /*
     * toString
     */
    @Override
    public String toString(){
      return "Rectangle = "+this.apoint +", "+ this.color +", "+ this.width +","+ this.hight;
    
    }
}
